﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/SideNav.Master" AutoEventWireup="true" CodeBehind="HomeManager.aspx.cs" Inherits="Planetwork.Admin.HomeManager" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   
    <ul class="nav nav-tabs">
        <li class="active"><a href="#manager" data-toggle ="tab">管理</a></li>
        <li><a href="#add" data-toggle ="tab">添加</a></li>
    </ul>
    <div class="tab-content">
        <div id="manager" class="tab-pane fade in active col-sm-10">
            <br />
            
             <asp:GridView ID="showDefault" runat="server" CssClass="table table-responsive table-hover" AutoGenerateColumns="false" DataKeyNames="ID" OnRowCommand="showDefault_RowCommand" >
                <Columns>
                    <asp:TemplateField ItemStyle-CssClass="hidden" HeaderStyle-CssClass="hidden">
                        <ItemTemplate>
                            <asp:Label ID="id"  runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="Operation">
                        <ItemTemplate>
                            <asp:Button ID="delteBtn" runat="server" Text="Delete" CommandName="del" CommandArgument='<%# Eval("ID") %>' CssClass="btn btn-danger" />
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="Title">
                        <ItemTemplate>
                            <a href="HomeDateils.aspx?id=<%# Eval("ID")%>" > <asp:Label runat="server" Text='<%# Eval("Title") %>'></asp:Label> </a>
                        </ItemTemplate>
                    </asp:TemplateField>

                   <asp:TemplateField HeaderText="Home Content">
                       <ItemTemplate>
                           <asp:Label runat="server" Text='<%# Eval("Content").ToString().Length > 15 ? Eval("Content").ToString().Substring(0,14) + "..." : Eval("Content")  %>'></asp:Label>
                       </ItemTemplate>
                   </asp:TemplateField>

                </Columns>
            </asp:GridView>
           
        </div>

        <div id="add" class="tab-pane fade col-sm-5">
           <div class="form-group" style="margin-top:30px;">
                <label class="text-left">标题</label>
                <asp:TextBox ID="title" runat="server" CssClass="form-control"></asp:TextBox>
           </div>
           <div class="form-group">
               <label>Home内容</label>
               <asp:TextBox ID="content" runat="server" CssClass="form-control" TextMode="MultiLine"></asp:TextBox>
           </div>
            <div class="form-group">
                <label>About内容</label>
                <asp:TextBox ID="about" runat="server" CssClass="form-control" TextMode="MultiLine"></asp:TextBox>
            </div>
            <div class="form-group">
                <label><span class="glyphicon-cloud-upload">图片</span></label>
                <asp:FileUpload ID="image" runat="server" />              
            </div>
            <div class="form-group">
                <asp:Button ID="submitBtn" runat="server" Text="添加" CssClass="btn btn-default center-block" OnClick="submitBtn_Click" />
            </div>
        </div>
    </div>

     <div id="paging" class="col-sm-10">
        <ul class="pagination pull-right">
            <li><asp:Button runat="server" OnClick="Paging" Text="首页" CssClass="btn btn-default" /> </li>  
            <asp:PlaceHolder ID="pagingBtnGroup" runat="server"></asp:PlaceHolder>
            <li><asp:Button runat="server" OnClick="Paging" Text="末页" CssClass="btn btn-default" /> </li>     
        </ul>
    </div>
</asp:Content>
